from django.conf.urls import patterns, include, url
from django.views.generic.simple import redirect_to
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from detlefschneider.gallery.sitemaps import CategorySitemap, GallerySitemap
from detlefschneider.about.sitemaps import AboutSitemap, ContactSitemap

admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', redirect_to, {'url': '/category/latest/'}, name='home'),

    url(r'^category/(?P<category>[a-zA-Z0-9-_]+)/$', 'detlefschneider.gallery.views.category', name='gallery_category'),
    url(r'^category/(?P<category>[a-zA-Z0-9-_]+)/all/$', 'detlefschneider.gallery.views.category', {'view': 'grid'}, name='gallery_category_all'),
    url(r'^gallery/(?P<gallery>[a-zA-Z0-9-_]+)/$', 'detlefschneider.gallery.views.gallery', name='gallery_gallery'),

    url(r'^about/$', 'detlefschneider.about.views.about', name='about_about'),
    url(r'^about/contact/$', 'detlefschneider.about.views.contact', name='about_contact'),

    url(r'^ds.admin/', include(admin.site.urls)),
)

sitemaps = {
    'category': CategorySitemap,
    'gallery': GallerySitemap,
    'about': AboutSitemap,
    'contact': ContactSitemap,
}
urlpatterns += patterns('',
	(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps})
)